<!-- 新闻板块 -->
<template>
  <div>
    <ul class="mui-table-view">
      <li class="mui-table-view-cell mui-media" v-for="item in newList" :key="item.id">
        <router-link :to="'/home/newsinfo/' + item.id" class="">
          <img :src="item.img_url" class="mui-media-object mui-pull-left">
          <div class="mui-media-body">
            <h1>{{item.title}}</h1>
            <p class="mui-ellipsis">
              <span>发表时间:{{item.add_time | dateFormat('YYYY-MM-DD')}}</span> <span data-v-987c4b4c="">点击:{{ item.click }}次</span>
            </p>
          </div>
        </router-link>
      </li>
    </ul>
  </div>
</template>

<script>
  export default {
    data() {
      return {
          newList : {}
      };
    },
    created () {
        this.getlunbo()
    },
    components: {},

    computed: {},

    mounted: {},

    methods: {
      getlunbo() {
        this.$http.get("http://027xin.com:8899/api/getnewslist").then(res => {
            // console.log(res.body)
            if(res.body.status === 0){
                this.newList = res.body.message
            }else{
                console.log('獲取新聞列表失敗!')
            }
        });
      }
    }
  };

</script>
<style scoped lang="less">
   .mui-table-view {
  li {
    h1 {
      font-size: 14px;
    }
    .mui-ellipsis {
      font-size: 12px;
      color: #0094ff;
      display: flex;
      justify-content: space-between;
    }
  }
}
</style>
